<?php
use yii\helpers\StringHelper;
use yii\widgets\ListView;

/* @var $this yii\web\View */
$this->title = $collectionModel->title;

\Yii::$app->view->registerMetaTag([
    'name' => 'description',
    'content' => StringHelper::truncate(strip_tags($collectionModel->description), 120),
]);

?>

<div class="container base-container">
    <div class="row">
        <div class="col-sm-12">
            <h1><?= $collectionModel->title ?></h1>
            <p><?= $collectionModel->description ?></p>
        </div>
    </div>
</div>

<div class="container base-container">
    <div class="row">
        <?php
            echo ListView::widget([
                'dataProvider' => $dataProvider,
                'options' => ['class' => 'container with-gap-and-delimiter'],
                'itemOptions' => [
                    'tag' => false,
                ],
                'itemView' => 'fondItem',
                'viewParams' => [
                    'collectionId' => $collectionModel->id,
                ],
                'layout' => '
                    <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">{items}</div> 
                    <div class="pagination-container">{pager}</div>
                ',
            ]);
        ?>
    </div>
</div>

